package day6homework;

import java.util.Scanner;

public class VehicleTest {
	public static void main(String[] args) {
		Vehicle vehicle = new Vehicle();
		// 调用输入初始速度的方法
		Scanner scanner = new Scanner(System.in);
		System.out.println("请输入汽车体积：");
		int size = scanner.nextInt();
		vehicle.setSize(size);
		System.out.println("请输入汽车速度：");
		int speed = scanner.nextInt();
		vehicle.setSpeed(speed);
		System.out.println(vehicle.toString());

		System.out.println("请输入汽车速度的变化量：");
		int speedChange = scanner.nextInt();
		if (speedChange > 0) {
			System.out.print("当前汽车的速度为：" + vehicle.speedUp(speedChange));
		} else {
			System.out.println("当前汽车的速度为：" + vehicle.speedDown((-1) * speedChange));
		}
	}
}